package com.fantabest.common.entity;

import java.io.Serializable;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NullValue;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Manager implements Serializable {

	private static final long serialVersionUID = -1801973657464347224L;
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent(nullValue = NullValue.EXCEPTION)
	private String name;
	@Persistent(nullValue = NullValue.EXCEPTION)
	private String surname;
	@Persistent(nullValue = NullValue.EXCEPTION)
	private String nickname;
	@Persistent(nullValue = NullValue.EXCEPTION)
	private String email;
	@Persistent(nullValue = NullValue.EXCEPTION)
	private String pwd;
	@Persistent
	private boolean isAdmin=false;
	@Persistent(mappedBy = "manager")
	List<Team> teams;
	

	public Manager(){}

	public Manager(String name, String surname, String nickname,
			String email, String pwd) {
		super();
		this.name = name;
		this.surname = surname;
		this.nickname = nickname;
		this.email = email;
		this.pwd = pwd;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public List<Team> getTeams() {
		return teams;
	}

	public void setTeams(List<Team> teams) {
		this.teams = teams;
	}

	public boolean isAdmin() {
		return isAdmin;
	}

	public void setAdmin(boolean isAdmin) {
		this.isAdmin = isAdmin;
	}

}
